import os

def main():
    path = "F:\BeautifulPictures\\2022"  # 文件夹目录
    # files = os.listdir(path)  # 得到文件夹下的所有文件名称
    for dirpath, dirnames, filenames in os.walk(path):
        print('Directory', dirpath)
        for filename in filenames:
            print(' File', dirpath+"\\"+filename)


if __name__ == '__main__':
    main()